import React, { useState, forwardRef, useImperativeHandle } from "react";

const Count = (props: any, ref: any) => {
  const [title, setTitle] = useState("hello react");
  useImperativeHandle(ref, () => ({
    handleChangeTitle: () => {
      setTitle("hello words!");
    },
  }));
  return (
    <>
      <div>{title}</div>
    </>
  );
};
export default forwardRef(Count);
